#include <iostream>
#include "simpleble/SimpleBLE.h"
#include "database/database.hpp"
#include <Windows.h>
#include <filesystem>
#include <string>

std::filesystem::path getProgramPath(const char* argv0);

int main(int argc, char* argv[]) {
	std::filesystem::path pwd = getProgramPath(argv[0]);
	if (!std::filesystem::exists(pwd / "data.db")) {
		Database::createDatebaseFile((pwd / "data.db").string());
	}
	Database database((pwd / "data.db").string());

	system("pause");
	return 0;
}

std::filesystem::path getProgramPath(const char* argv0) {
	std::filesystem::path exePath = std::filesystem::canonical(std::filesystem::path(argv0));
	return exePath.parent_path();
}